<template>
  <header-back :fixed="fixed" :title="text || title" ref="header">
    <slot slot="left" name="left" v-if="$slots.left"></slot>
    <mt-button @click="handleBack" v-else slot="left">
      <i class="xffont xf-cha" slot="icon"></i>
      <span>&nbsp;&nbsp;&nbsp;</span>
    </mt-button>
    <slot name="right" slot="right"></slot>
  </header-back>
</template>
<script>
  import HeaderBack from '../header-back/header-back'
  export default {
    components: {HeaderBack},
    props: {
      text: {type: null},
      fixed: {type: Boolean, default: false},
      title: {type: null, default: ''}
    },
    name: 'header-close',
    data() {
      return {}
    },
    methods: {
      handleBack() {
        this.$refs.header.handleBack()
      }
    },
    created() {}
  }
</script>
